home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Idle / Delayer.h < prev    next >
Text File  |  1997-06-28  |  718b  |  49 lines

  1. // Delayer.h
  2.  
  3. #ifndef Delayer_h
  4. #define Delayer_h
  5.  
  6. #ifndef Heap_h
  7. #include "Heap.h"
  8. #endif
  9. #ifndef HeapLink_h
  10. #include "HeapLink.h"
  11. #endif
  12. #ifndef Postponer_h
  13. #include "Postponer.h"
  14. #endif
  15. #ifndef Tick_h
  16. #include "Tick.h"
  17. #endif
  18.  
  19. class Delayer
  20.   {
  21.     private:
  22.         HeapLink<Delayer> delayLink;
  23.         Postponer postponer;
  24.         Tick when;
  25.  
  26.         static Heap<Delayer>& Waiting();
  27.         
  28.     public:
  29.         Delayer( const Method& );
  30.         ~Delayer();
  31.         
  32.         bool Pending() const;
  33.         void DelayBy( uint32 time );
  34.         void DelayTo( Tick );
  35.         
  36.         void Cancel();
  37.         void Hasten();
  38.         void Flush();
  39.         
  40.         Tick ScheduledTime() const        { return when; }
  41.         
  42.         static void ScheduleTasks();
  43.         static uint32 SleepTime();
  44.         
  45.         bool Before( const Delayer& ) const;
  46.   };
  47.  
  48. #endif
  49.